-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
executor: special handling is required when an "auto id out of range" error occurs in insert ignore into ... on on duplicate ...
(#39847)
#40286
Conversation
Signed-off-by: Dousir9 <736191200@qq.com>
minor Co-authored-by: Mattias Jonsson <mjonss@users.noreply.github.com>
minor Co-authored-by: Mattias Jonsson <mjonss@users.noreply.github.com>
[REVIEW NOTIFICATION] This pull request has not been approved. To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
@ti-chi-bot: This cherry pick PR is for a release branch and has not yet been approved by release team. To merge this cherry pick, it must first be approved by the collaborators. AFTER it has been approved by collaborators, please ping the release team in a comment to request a cherry pick review. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/hold high priority for trunk branch |
/unhold |
@ti-chi-bot: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
This is an automated cherry-pick of #39847
What problem does this PR solve?
Issue Number: close #38950
Problem Summary:
What is changed and how it works?
The code below is added by PR #30301 to fix Issue #29483. When
replace
encounters a duplicatePRIMARY KEY
orUNIQUE KEY
, it is expected to have the semantics ofDELETE
+INSERT
, when Auto ID is out of range, the truncated ID is possible to duplicate with an existing ID, this leads to data corruption as unrelated rows are modified and removed.So when the
ignore
keyword exists in the SQL (orSET sql_mode='NO_ENGINE_SUBSTITUTION';
), if the Auto ID is out of range, the above code preventsreplace into
before it is actually executed, but it also prevents a lot SQLs that need to be executed, so special handling is required when anauto id out of range
error occurs ininsert ignore into ... on duplicate ...
to allow SQL to be executed successfully.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.